package com.app.controller;

import org.apache.commons.lang.math.RandomUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.app.dao.UserDao;
import com.app.model.User;

@Controller
public class UserController {
	@Autowired
	private UserDao userDao;
	@RequestMapping("user")
	@ResponseBody
	public String getUser(){
		User u = new User();
		u.setUsername("zhang"+RandomUtils.nextInt()%10);
		u.setPassword("pass"+RandomUtils.nextInt()%100);
		userDao.save(u);
		return "a.jsp";
	}
}
